import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const constRouter = [
  {
    path: '/',
    name: 'layout',
    redirect: '/home/index',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ './views/layout/index.vue'),
    meta: {
      title: '首页',
      icon: 'home'
    },
    children: [
      {
        path: '/home/index',
        name: 'home-index',
        component: () => import(/* webpackChunkName: "about" */ './views/home/index.vue'),
        meta: {
          title: '系统概览',
          icon: 'home_info'
        },
      },
      {
        path: '/home/tabs',
        name: 'home-tabs',
        component: () => import('./views/home/tabs.vue'),
        meta: {
          title: 'tabs标签页',
          icon: 'tabs'
        },
      }
    ]
  }
]
export default new Router({
  routes: constRouter
})

export {
  constRouter
}